var $1=function(){return document.getElementById(arguments[0]);}
function imgPoint(){
	this.TitleDemo = "";
	this.ButtonDemo = "";
	this.BodyDemo = "";
    this.DataSource = "";
    this.DataStep = 0;
	this.DelayTime = 3000;
	this.Broswer = /MSIE/.test(window.navigator.userAgent);
	this.DataSource=null;
	this.Timer=null;
}
imgPoint.prototype.DataBind=function(){
    var me=this;
    for(var i=0;i<this.DataSource.length;i++){
        var Link=document.createElement("a");
        Link.innerHTML=i+1;
        Link.onclick=function(e){
            e=e||window.event;
            var tar=e.srcElement||e.target;
            me.ChangeImg(parseInt(tar.innerHTML)-1);
        }
        $1(this.ButtonDemo).appendChild(Link);
    }
	this.Show();
};
imgPoint.prototype.Show = function(){
    var me=this;
    with(this){
        Broswer?Filter(DataStep):DisPlay(DataStep);
        DataStep = DataStep + 1;
        if(DataStep >= DataSource.length)DataStep=0;
		Timer=window.setTimeout(function(){me.Show();},DelayTime);
    }
};
imgPoint.prototype.ChangeImg = function(num){
    var me=this;   
    with(this){
        window.clearTimeout(Timer);
        DataStep = num;
        Broswer?Filter(DataStep):DisPlay(DataStep);
        Timer=window.setTimeout(function(){me.Show();},DelayTime);
    }
};

//IE Only
imgPoint.prototype.Filter = function(num){
//    var tnum = 23;
//    var transitions_num = Math.floor(Math.random() * tnum);
//    var transitions = "revealTrans(duration=2,transition="+ transitions_num +")";//12,2 "+ transitions_num +"
//    var transitions = "progid:DXImageTransform.Microsoft.Stretch(duration=1,stretchStyle=SPIN)";
    with($1(this.BodyDemo).getElementsByTagName("img")[num]){
        style.filter = "BlendTrans(enabled=true,percent=10)";//transitions;
        filters[0].Apply();
        this.DisPlay(num);
        filters[0].Play();
    }
};
imgPoint.prototype.DisPlay = function(num){
    for(var i=0;i<this.DataSource.length;i++){
        $1(this.ButtonDemo).getElementsByTagName("a")[i].className=i==num?"active":"normal";
        this.DataSource[i].className=i==num?"show":"hidden";
    }
	$1(this.TitleDemo).innerHTML=this.DataSource[num].getAttribute("title");
};